package tContext
{
	import flash.filesystem.File;
	import flash.geom.Rectangle;

	public class TContext extends Object
	{
		private var _rectangle:Rectangle = new Rectangle(0, 0, 800, 600);
		private var _image_rectangle:Rectangle = new Rectangle(0, 0, 800, 600);
		private var _dir:File = new File();
		
		public function TContext()
		{
		}
		
        public function get rectangle():Rectangle {
            return _rectangle;
        }
        
        public function set rectangle(rec:Rectangle):void {
            if(rec) {
                if(rec.x < 0)
                    rec.x = 0;
                if(rec.y < 0)
                    rec.y = 0;
                if(rec.width < 500)
                    rec.width = 500;
                if(rec.height < 300)
                    rec.height = 300;
                _rectangle = rec;
            }
        }
        
        public function get imageRectangle():Rectangle {
            return _imageRectangle;
        }
        
        public function set imageRectangle(rec:Rectangle):void {
            if(rec) {
                if(rec.x < 0)
                    rec.x = 0;
                if(rec.y < 0)
                    rec.y = 0;
                if(rec.width < 500)
                    rec.width = 500;
                if(rec.height < 300)
                    rec.height = 300;
                _imageRectangle = rec;
            }
        }
        
        public function get path():String {
        	return _dir.nativePath;
        }
        
        public function set path(pStr:String):void {
        	_dir = _dir.resolvePath(pStr);
        }

        public function save() {
        	
        }
	}
}